#ifndef SimulationTime_H
#define SimulationTime_H

#include <string>
#include <ctime>
#include <string>

class Config;

using namespace std;


class SimulationTime {
public:

    SimulationTime(Config* config_);

    ~SimulationTime();

    bool loop()
    {
        itime++;
        timeNow += dt;
        if(itime > timestep_simulation)
        {
            return false;
        }
        else
        {
            return true;
        }
    }

    string get_time_string_io();

    bool is_time_io()
    {
        if(itime % timestep_io == 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    bool is_time_io_reset()
    {
        if(itime - 1 % timestep_io == 0 || timestep_io == 1)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    int itime;

    double timeNow;

    //time step for the simulation
    double dt;

    //number of total timesteps to perform in the simulation
    int timestep_simulation;

    int timestep_io;

    int timestep_average;

    //timestep for all kind collision
    //timestep for DSMC and coulomb should be several times of this timestep
    int timestep_collision;

    //number of timestep of performing coulomb collision
    int timestep_coulomb;

    //number of timestep of performing DSMC collision
    int timestep_DSMC;

    //number of timestep of performing DSMC collision
    int timestep_restore;

};

#endif
